﻿using System;
using System.Collections.Generic;
using System.Text;
using Mpi.Common.Collections;
using Xeml.Document.Contracts;

namespace Xeml.Document
{
    public class HandlerResourceCollection : ObservableIdCollectionBase<OntologyHandlerResource, string> 
    {
        private DocumentResources _doc;
        public DocumentResources DocumentResources
        {
            get
            {
                return _doc;
            }
        }

        public HandlerResourceCollection(DocumentResources owner)
        {
            _doc = owner;
        }

        protected override string GetIdentifiere(OntologyHandlerResource item)
        {
            return item.NameSpaceAlias;
        }

        protected override void SetOwner(OntologyHandlerResource item)
        {
            item.Collection = this;
        }

        protected override void RemoveOwner(OntologyHandlerResource item)
        {
            item.Collection = null;
        }
    }
}
